Characters

Character is an immediate type. Characters are manipulated primarily by converting into an integer and accessing these fields:

[start at bit 0, since equates char-int to char-code when there is no bits or font. All current systems use ASCII for the character codes, and define #
to be a linefeed, but system code should not count on this.

[Hemlock to describe modifiers in keyboard events, but there is no assumption of any general portable significance of character bits.

not particularly useful.

Characters should be converted to and from integers by using the char-int and int-char functions, which the compiler translates into these VOPs:
\begin{example}
char-int (char) => int
int-char (int) => char
\end{example}
In the common case where Char is known to be a string-char, these operations are equivalent to char-code and code-char. In addition to providing a portable interface to character conversion, the VOP representation of this type conversion allows the compiler to avoid unnecessary boxing and unboxing of character objects.

Existing code explicitly converts fixnums to characters by using the Make-Immediate-Type sub-primitive with of characters to fixnums is rather confused. Originally, characters were a subtype of the Misc type code, and the result of the Make-Fixnum sub-primitive had to be masked with other code may not.

Character comparisons could be implemented by doing numeric comparisons on the result of char-int, or by using eq in the case of char=, but this can result in unnecessary type conversions. Instead, the compiler uses these conditional VOPs:
\begin{example}
if-char= (x y)
if-char< (x y)
if-char> (x y)
\end{example}